package cn.edu.nuc.zyb.model;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class haha {

	public static void main(String[] args) throws Exception {

		

		/*FileOutputStream fos = new FileOutputStream("D:\\store\\user\\zhangyanbo");
		ObjectOutputStream oos = new ObjectOutputStream(fos);
		User user = new User("zhangyanbo", 123456, "zyb", 10);
		oos.writeObject(user);*/
		
		
		/*File file = new File("D:\\store\\cart\\haha");
		file.mkdirs();
		FileOutputStream fos = new FileOutputStream(file+"\\"+"zyb");
		ObjectOutputStream oos = new ObjectOutputStream(fos);
		Admin admin = new Admin("zhangyanbo", 123456, "zyb");
		oos.writeObject(admin);*/
		File file10 = new File("D:\\store\\goods");
		File[] files10 = file10.listFiles();
		FileInputStream fis9=null;
		ObjectInputStream ois9=null;
		FileInputStream fi9 =null;
		ObjectInputStream oi9=null;
		for(int i=0;i<files10.length;i++){
			fis9 = new FileInputStream(files10[i]);
			ois9= new ObjectInputStream(fis9);
			Goods goodsnum = (Goods)ois9.readObject();
			int oldnum =goodsnum.getNum();
			
//			fis9=new FileInputStream("D:\\store\\cart\\zhangyanbo"+"\\"+files10[i].getName());
			File file = new File("D:\\store\\cart\\zhangyanbo"+"\\"+files10[i].getName());
			System.out.println(file.getAbsolutePath());

	}}
}
